Improve track split.
Implement 'nuke types' in misc filters.
-If you're interested in contributing to this program, here are some\r
-guidelines. Mail patches to gpsbabel-code@lists.sourceforge.net for\r
-consideration and integration.\r
-\r
-Rules to Live By\r
-----------------\r
-\r
-Standards are good. ISO C and POSIX are greatly preferred.\r
-\r
-Reuse is good, if doing so is not onerous. For example, using the expat\r
-libraries vastly simplifies the XML parsers while increasing their\r
-robustness plus those libraries are ubiquitous. So I consider it OK to\r
-require expat.\r
-\r
-You may find format_skeleton.c and filter_skeleton.c in the source tree\r
-to be helpful examples. Just add meat!\r
-\r
-Compilers complain for a reason. Code shouldn't emit warnings.\r
-\r
-The entire world doesn't run <your OS here>. I've tested this code on\r
-at least five different OSes. If you find yourself wanting to insert\r
-compiler or OS specific magic, please resist.\r
-\r
-Coding consistency is encouraged. The reality is we have a lot of code\r
-that was written by different authors. Some code from other projects is\r
-included. We don't have immutable rules about code style (indention,\r
-curly location, whitespace rules, etc.) but we do ask that you try to\r
-match what is around any code you modify. "When in Rome..." \r
-\r
-If writing new code, we'd prefer a style like:\r
-\r
- int\r
- mumble(int whatever)\r
- {\r
- <tab>if (whatevever) {\r
- <tab><tab>return blah;\r
- <tab>}\r
- }\r
-\r
-...but if you're submitting a new source file that you intend to\r
-maintain and are convinced that two space indents will make the world a\r
-better place, knock yourself out. But if you need to add a line of code\r
-to the above before "return blah" and do it with spaces instead of hard\r
-tabs, that would be bad.\r
-\r
-Submitting Patches\r
-------------------\r
-\r
-If you are creating a new target you should submit patches (use \r
-"cvs diff -uN" to create patches) to the following files:\r
-* Yourcode.c and/or Yourcode.h - this is the code required to do your\r
- conversions and any support files that your code requires.\r
-* vecs.c - an updated vecs.c file implementing your conversion code into\r
- GPSBabel.\r
-* Makefile - an updated Makefile telling the compiler how to build and link\r
- your conversion into GPSBabel\r
-* testo - an updated script that tests your conversion (this should produce\r
- no output if all is good, see the current testo script for examples)\r
-* YourOutput - a sample file of code produced by your function (used in testo\r
- and lives in a directory called "reference").\r
-* Documentation - see below.\r
-\r
-Please ensure that you are building and testing against the latest code\r
-from the top of the CVS tree and that any code you modify is the latest\r
-version from the CVS - Note: code changes sometimes occur frequently!\r
-\r
-Documentation\r
--------------\r
-\r
-HTML and text documentation are generated automatically from DocBook \r
-source located in the "xmldoc" directory. That directory contains \r
-two subdirectories of interest: "formats" and "filters". If your\r
-contribution adds or affects a format, you'll want to be in the "formats"\r
-directory. Otherwise, you'll want to be in the "filters" directory.\r
-\r
-You should contribute a file called "yourname.xml", where "yourname" is the\r
-name you would give on the command-line to invoke your new format or filter. \r
-For example, the arc filter is documented in "filters/arc.xml".\r
-\r
-This file contains a general description of your format or filter, any \r
-limitations in your support for it, and anything else the end user should \r
-know. For file formats, links to manufacturers' websites are encouraged. \r
-The contents of this file are not valid or even well-formed XML on their own; \r
-they are included into a larger framework. If you know DocBook, you should \r
-ensure that the contents of this file will validate if included in a <section>.\r
-If you do not know DocBook, see the other files in this directory for examples \r
-or see http://docbook.org/tdg/en/html/docbook.html for the gory details. Tags \r
-of interest will almost certainly include <para> for paragraphs, \r
-<ulink url="..."> for web links, and <screen format="linespecific"> for \r
-example command lines.\r
-\r
-For each option supported by your format or filter, you should also contribute\r
-a file in the "options" subdirectory called "yourname-youroption.xml", again\r
-using the names you would use on the command line to invoke your format or \r
-filter with that particular option. For example, the "distance" option to the\r
-"arc" filter is documented in "filters/options/arc-distance.xml". These \r
-files are similar to the general description above, and should meet the same\r
-validation requirements.\r
-\r
-As of this writing, there are two formats that violate this rule: Magellan \r
-serial and Microsoft Streets & Trips. Because those formats have the same\r
-names as other formats, their descriptions are located in "magellan1.xml" and\r
-"msroute1.xml" respectively. These are special cases, and you should do your\r
-best to ensure that they remain the only special cases.\r
-\r
-Note that the automated framework already includes the name and description of\r
-your format and its options as described in vecs.c and yourcode.c, so there is\r
-no need to repeat that information in your documentation.\r
-\r
-\r
-Enjoy!\r
-\r
-Robert Lipe,\r
-robertlipe@usa.net\r
+If you're interested in contributing to this program, here are some
+guidelines. Mail patches to gpsbabel-code@lists.sourceforge.net for
+consideration and integration.
+
+Rules to Live By
+----------------
+
+Standards are good. ISO C and POSIX are greatly preferred.
+
+Reuse is good, if doing so is not onerous. For example, using the expat
+libraries vastly simplifies the XML parsers while increasing their
+robustness plus those libraries are ubiquitous. So I consider it OK to
+require expat.
+
+You may find format_skeleton.c and filter_skeleton.c in the source tree
+to be helpful examples. Just add meat!
+
+Compilers complain for a reason. Code shouldn't emit warnings.
+
+The entire world doesn't run <your OS here>. I've tested this code on
+at least five different OSes. If you find yourself wanting to insert
+compiler or OS specific magic, please resist.
+
+Coding consistency is encouraged. The reality is we have a lot of code
+that was written by different authors. Some code from other projects is
+included. We don't have immutable rules about code style (indention,
+curly location, whitespace rules, etc.) but we do ask that you try to
+match what is around any code you modify. "When in Rome..."
+
+If writing new code, we'd prefer a style like:
+
+ int
+ mumble(int whatever)
+ {
+ <tab>if (whatevever) {
+ <tab><tab>return blah;
+ <tab>}
+ }
+
+...but if you're submitting a new source file that you intend to
+maintain and are convinced that two space indents will make the world a
+better place, knock yourself out. But if you need to add a line of code
+to the above before "return blah" and do it with spaces instead of hard
+tabs, that would be bad.
+
+Submitting Patches
+------------------
+
+If you are creating a new target you should submit patches (use
+"cvs diff -uN" to create patches) to the following files:
+* Yourcode.c and/or Yourcode.h - this is the code required to do your
+ conversions and any support files that your code requires.
+* vecs.c - an updated vecs.c file implementing your conversion code into
+ GPSBabel.
+* Makefile - an updated Makefile telling the compiler how to build and link
+ your conversion into GPSBabel
+* testo - an updated script that tests your conversion (this should produce
+ no output if all is good, see the current testo script for examples)
+* YourOutput - a sample file of code produced by your function (used in testo
+ and lives in a directory called "reference").
+* Documentation - see below.
+
+Please ensure that you are building and testing against the latest code
+from the top of the CVS tree and that any code you modify is the latest
+version from the CVS - Note: code changes sometimes occur frequently!
+
+Documentation
+-------------
+
+HTML and text documentation are generated automatically from DocBook
+source located in the "xmldoc" directory. That directory contains
+two subdirectories of interest: "formats" and "filters". If your
+contribution adds or affects a format, you'll want to be in the "formats"
+directory. Otherwise, you'll want to be in the "filters" directory.
+
+You should contribute a file called "yourname.xml", where "yourname" is the
+name you would give on the command-line to invoke your new format or filter.
+For example, the arc filter is documented in "filters/arc.xml".
+
+This file contains a general description of your format or filter, any
+limitations in your support for it, and anything else the end user should
+know. For file formats, links to manufacturers' websites are encouraged.
+The contents of this file are not valid or even well-formed XML on their own;
+they are included into a larger framework. If you know DocBook, you should
+ensure that the contents of this file will validate if included in a <section>.
+If you do not know DocBook, see the other files in this directory for examples
+or see http://docbook.org/tdg/en/html/docbook.html for the gory details. Tags
+of interest will almost certainly include <para> for paragraphs,
+<ulink url="..."> for web links, and <screen format="linespecific"> for
+example command lines.
+
+For each option supported by your format or filter, you should also contribute
+a file in the "options" subdirectory called "yourname-youroption.xml", again
+using the names you would use on the command line to invoke your format or
+filter with that particular option. For example, the "distance" option to the
+"arc" filter is documented in "filters/options/arc-distance.xml". These
+files are similar to the general description above, and should meet the same
+validation requirements.
+
+As of this writing, there are two formats that violate this rule: Magellan
+serial and Microsoft Streets & Trips. Because those formats have the same
+names as other formats, their descriptions are located in "magellan1.xml" and
+"msroute1.xml" respectively. These are special cases, and you should do your
+best to ensure that they remain the only special cases.
+
+Note that the automated framework already includes the name and description of
+your format and its options as described in vecs.c and yourcode.c, so there is
+no need to repeat that information in your documentation.
+
+
+Enjoy!
+
+Robert Lipe,
+robertlipe@usa.net
-* Adding your own language to GPSBabelFE *\r
--------------------------------------------\r
-\r
-To be written.\r
-\r
+* Adding your own language to GPSBabelFE *
+-------------------------------------------
+
+To be written.
+
<rect>
<x>0</x>
<y>0</y>
- <width>710</width>
- <height>430</height>
+ <width>650</width>
+ <height>284</height>
</rect>
</property>
<property name="windowTitle">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
- <widget class="QLabel" name="label">
- <property name="text">
- <string/>
- </property>
- <property name="pixmap">
- <pixmap resource="app.qrc">:/images/appicon.png</pixmap>
- </property>
- <property name="scaledContents">
- <bool>false</bool>
- </property>
- </widget>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label">
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>100</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="app.qrc">:/images/appicon.png</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
</item>
<item>
<widget class="QTextEdit" name="textEdit">
// -*- C++ -*-
-// $Id: advdlg.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $
+// $Id: advdlg.cpp,v 1.3 2009/11/02 20:38:02 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
//------------------------------------------------------------------------
AdvDlg::AdvDlg(QWidget* parent,
bool &synthShortNames,
- bool &forceGPSTypes,
bool &enableCharSetXform,
bool &previewGmap,
int &debugLevel):
QDialog(parent),
synthShortNames(synthShortNames),
- forceGPSTypes(forceGPSTypes),
enableCharSetXform(enableCharSetXform),
previewGmap(previewGmap),
debugLevel(debugLevel)
{
ui.setupUi(this);
ui.synthShortNames->setChecked(synthShortNames);
- ui.forceGPSTypes->setChecked(forceGPSTypes);
ui.enableCharSetXform->setChecked(enableCharSetXform);
ui.previewGmap->setChecked(previewGmap);
ui.debugCombo->setCurrentIndex(debugLevel+1);
void AdvDlg::acceptClicked()
{
synthShortNames = ui.synthShortNames->isChecked();
- forceGPSTypes = ui.forceGPSTypes->isChecked();
enableCharSetXform = ui.enableCharSetXform->isChecked();
previewGmap = ui.previewGmap->isChecked();
debugLevel = ui.debugCombo->currentIndex()-1;
// -*- C++ -*-
-// $Id: advdlg.h,v 1.1 2009/07/05 21:14:56 robertl Exp $
+// $Id: advdlg.h,v 1.2 2009/11/02 20:38:02 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
public:
AdvDlg(QWidget* parent,
bool &synthShortNames,
- bool &forceGPSTypes,
bool &enableCharSetXform,
bool &previewGmap,
int &debugLevel);
private:
Ui_AdvUi ui;
bool &synthShortNames;
- bool &forceGPSTypes;
bool &enableCharSetXform;
bool &previewGmap;
int &debugLevel;
<rect>
<x>0</x>
<y>0</y>
- <width>347</width>
- <height>222</height>
+ <width>280</width>
+ <height>185</height>
</rect>
</property>
<property name="windowTitle">
</property>
</widget>
</item>
- <item>
- <widget class="QCheckBox" name="forceGPSTypes">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Force Selected GPS data types (nuketypes filter)</string>
- </property>
- </widget>
- </item>
<item>
<widget class="QCheckBox" name="enableCharSetXform">
<property name="enabled">
-IDI_ICON1 ICON DISCARDABLE "images/appicon.ico"\r
+IDI_ICON1 ICON DISCARDABLE "images/appicon.ico"
// -*- C++ -*-
-// $Id: filterdata.cpp,v 1.3 2009/08/28 17:08:55 robertl Exp $
+// $Id: filterdata.cpp,v 1.4 2009/11/02 20:38:02 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
if (speed) s += ",speed";
if (pack) s += ",pack";
if (merge) s += ",merge";
- if (split && (pack || merge)) {
- s += ",split";
- if (splitTime > 0)
- s += QString("=%1%2").arg(splitTime).arg("mhd"[splitTimeUnit]);
- }
- if (splitDist > 0) {
- double d = splitDist;
- char u = ' ';
- if (splitDistUnit == 0) { // ft.
- d /= 5280.0; u = 'm';
- }
- else if (splitDistUnit == 1) { //m
- d /= 1000.0; u = 'k';
+ if (pack || merge) {
+ if (splitByDate) {
+ s += ",split";
}
- else if (splitDistUnit == 2) { //km
- u = 'k';
+ if (splitByTime) {
+ s += ",split";
+ if (splitTime > 0)
+ s += QString("=%1%2").arg(splitTime).arg("mhd"[splitTimeUnit]);
}
- else if (splitDistUnit == 3) { //m
- u = 'm';
+ if (splitByDistance && splitDist > 0) {
+ double d = splitDist;
+ char u = ' ';
+ if (splitDistUnit == 0) { // ft.
+ d /= 5280.0; u = 'm';
+ }
+ else if (splitDistUnit == 1) { //m
+ d /= 1000.0; u = 'k';
+ }
+ else if (splitDistUnit == 2) { //km
+ u = 'k';
+ }
+ else if (splitDistUnit == 3) { //m
+ u = 'm';
+ }
+ s += QString(",sdistance=%1%2").arg(d).arg(u);
}
- s += QString(",sdistance=%1%2").arg(d).arg(u);
}
if (start) s += QString(",start=%1").arg(optionDate(startTime, TZ));
if (!inUse)
return args;
+ if (nukeRoutes || nukeTracks || nukeWaypoints) {
+ args << QString("-x");
+ QString s = "nuketypes";
+ if (nukeRoutes) s += ",routes";
+ if (nukeTracks) s += ",tracks";
+ if (nukeWaypoints) s += ",waypoints";
+ args << s;
+ }
+
if (swap) args << "-x" << "swap";
if (transform) {
// -*- C++ -*-
-// $Id: filterdata.h,v 1.3 2009/09/02 19:05:27 robertl Exp $
+// $Id: filterdata.h,v 1.4 2009/11/02 20:38:02 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
stop(false),
pack(false), merge(false), split(false),
GPSFixes(false), GPSFixesVal(0),
+ splitByDate(false),
+ splitByTime(false),
+ splitByDistance(false),
course(false), speed(false),
splitTime(0), splitTimeUnit(0),
splitDist(0), splitDistUnit(0)
sg.addVarSetting(new BoolSetting("trks.pack", pack));
sg.addVarSetting(new BoolSetting("trks.merge", merge));
sg.addVarSetting(new BoolSetting("trks.split", split));
+ sg.addVarSetting(new BoolSetting("trks.splitByDate", splitByDate));
+ sg.addVarSetting(new BoolSetting("trks.splitByTime", splitByTime));
+ sg.addVarSetting(new BoolSetting("trks.splitByDistance", splitByDistance));
sg.addVarSetting(new BoolSetting("trks.start", start));
sg.addVarSetting(new DateTimeSetting("trks.startTime", startTime));
sg.addVarSetting(new BoolSetting("trks.stop", stop));
QDateTime stopTime;
bool pack, merge, split, GPSFixes;
int GPSFixesVal;
+ bool splitByDate, splitByTime, splitByDistance;
bool course, speed;
int splitTime, splitTimeUnit;
int splitDist, splitDistUnit;
class MiscFltFilterData: public FilterData {
public:
MiscFltFilterData(): FilterData(),
+ nukeRoutes(false),
+ nukeTracks(false),
+ nukeWaypoints(false),
transform(false),
del(false),
swap(false),
virtual QStringList makeOptionString();
virtual void makeSettingGroup(SettingGroup &sg)
{
+ sg.addVarSetting(new BoolSetting("mscflt.nukeRoutes", nukeRoutes));
+ sg.addVarSetting(new BoolSetting("mscflt.nukeTracks", nukeTracks));
+ sg.addVarSetting(new BoolSetting("mscflt.nukeWaypoints", nukeWaypoints));
sg.addVarSetting(new BoolSetting("mscflt.inUse", inUse));
sg.addVarSetting(new BoolSetting("mscflt.transform", transform));
sg.addVarSetting(new IntSetting("mscflt.transformVal", transformVal));
}
public:
+ bool nukeRoutes, nukeTracks, nukeWaypoints;
bool transform, del, swap;
int transformVal;
};
// -*- C++ -*-
-// $Id: filterwidgets.cpp,v 1.4 2009/09/14 14:25:14 robertl Exp $
+// $Id: filterwidgets.cpp,v 1.5 2009/11/02 20:38:02 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
addCheckEnabler(ui.stopCheck, ui.stopEdit);
addCheckEnabler(ui.GPSFixesCheck, ui.GPSFixesCombo);
+ addCheckEnabler(ui.splitTimeCheck,
+ (QList<QWidget *> ()
+ <<ui.splitTimeSpin
+ <<ui.splitTimeCombo));
+ addCheckEnabler(ui.splitDistanceCheck,
+ (QList<QWidget *> ()
+ <<ui.splitDistSpin
+ <<ui.splitDistCombo));
+
connect(ui.mergeCheck, SIGNAL(clicked()) , this, SLOT(mergeCheckX()));
- connect(ui.splitCheck, SIGNAL(clicked()) , this, SLOT(OtherCheckX()));
connect(ui.packCheck, SIGNAL(clicked()), this, SLOT(packCheckX()));
- connect(ui.startCheck, SIGNAL(clicked()), this, SLOT(OtherCheckX()));
- connect(ui.stopCheck, SIGNAL(clicked()), this, SLOT(OtherCheckX()));
+ connect(ui.startCheck, SIGNAL(clicked()), this, SLOT(otherCheckX()));
+ connect(ui.stopCheck, SIGNAL(clicked()), this, SLOT(otherCheckX()));
+
+ connect(ui.splitDateCheck, SIGNAL(clicked()), this, SLOT(splitDateX()));
+ connect(ui.splitTimeCheck, SIGNAL(clicked()), this, SLOT(splitTimeX()));
+ connect(ui.splitDistanceCheck, SIGNAL(clicked()), this, SLOT(splitDistanceX()));
ui.startEdit->setDisplayFormat("dd MMM yyyy hh:mm:ss AP");
ui.stopEdit->setDisplayFormat("dd MMM yyyy hh:mm:ss AP");
fopts << new BoolFilterOption(tfd.stop, ui.stopCheck);
fopts << new BoolFilterOption(tfd.pack, ui.packCheck);
fopts << new BoolFilterOption(tfd.merge, ui.mergeCheck);
- fopts << new BoolFilterOption(tfd.split, ui.splitCheck);
+ fopts << new BoolFilterOption(tfd.splitByDate, ui.splitDateCheck);
+ fopts << new BoolFilterOption(tfd.splitByTime, ui.splitTimeCheck);
+ fopts << new BoolFilterOption(tfd.splitByDistance, ui.splitDistanceCheck);
fopts << new BoolFilterOption(tfd.GPSFixes, ui.GPSFixesCheck);
fopts << new BoolFilterOption(tfd.course, ui.courseCheck);
fopts << new BoolFilterOption(tfd.speed, ui.speedCheck);
}
//------------------------------------------------------------------------
-void TrackWidget::OtherCheckX()
+void TrackWidget::otherCheckX()
{
ui.TZCheck->setEnabled(ui.stopCheck->isChecked() || ui.startCheck->isChecked());
- ui.splitCheck->setEnabled(ui.mergeCheck->isChecked() || ui.packCheck->isChecked());
- bool bb = ui.packCheck->isChecked() && ui.splitCheck->isChecked();
- ui.splitTimeSpin->setEnabled(bb);
- ui.splitTimeCombo->setEnabled(bb);
-
- bb = ui.packCheck->isChecked();
- ui.splitDistSpin->setEnabled(bb);
- ui.splitDistCombo->setEnabled(bb);
+
+ ui.splitTimeSpin->setEnabled(ui.splitTimeCheck->isChecked());
+ ui.splitTimeCombo->setEnabled(ui.splitTimeCheck->isChecked());
+ ui.splitDistSpin->setEnabled(ui.splitDistanceCheck->isChecked());
+ ui.splitDistCombo->setEnabled(ui.splitDistanceCheck->isChecked());
+
+ bool bb = (ui.mergeCheck->isChecked() || ui.packCheck->isChecked());
+ ui.splitDateCheck->setEnabled(bb);
+ ui.splitTimeCheck->setEnabled(bb);
+ ui.splitDistanceCheck->setEnabled(bb);
}
//------------------------------------------------------------------------
{
if (ui.mergeCheck->isChecked())
ui.packCheck->setChecked(false);
- OtherCheckX();
+ otherCheckX();
}
//------------------------------------------------------------------------
-
void TrackWidget::packCheckX()
{
if (ui.packCheck->isChecked())
ui.mergeCheck->setChecked(false);
- OtherCheckX();
+ otherCheckX();
}
+//------------------------------------------------------------------------
+void TrackWidget::splitDateX()
+{
+ if (ui.splitDateCheck->isChecked()) {
+ ui.splitTimeCheck->setChecked(false);
+ ui.splitDistanceCheck->setChecked(false);
+ }
+ otherCheckX();
+}
+//------------------------------------------------------------------------
+void TrackWidget::splitTimeX()
+{
+ if (ui.splitTimeCheck->isChecked()) {
+ ui.splitDateCheck->setChecked(false);
+ ui.splitDistanceCheck->setChecked(false);
+ }
+ otherCheckX();
+}
+//------------------------------------------------------------------------
+void TrackWidget::splitDistanceX()
+{
+ if (ui.splitDistanceCheck->isChecked()) {
+ ui.splitDateCheck->setChecked(false);
+ ui.splitTimeCheck->setChecked(false);
+ }
+ otherCheckX();
+}
+
+
//------------------------------------------------------------------------
//------------------------------------------------------------------------
WayPtsWidget::WayPtsWidget(QWidget *parent, WayPtsFilterData &wfd): FilterWidget(parent) , wfd(wfd)
fopts << new BoolFilterOption(mfd.transform, ui.transformCheck);
fopts << new BoolFilterOption(mfd.swap, ui.swapCheck);
fopts << new BoolFilterOption(mfd.del, ui.deleteCheck);
+ fopts << new BoolFilterOption(mfd.nukeTracks, ui.nukeTracks);
+ fopts << new BoolFilterOption(mfd.nukeRoutes, ui.nukeRoutes);
+ fopts << new BoolFilterOption(mfd.nukeWaypoints, ui.nukeWaypoints);
fopts << new ComboFilterOption(mfd.transformVal, ui.transformCombo);
setWidgetValues();
// -*- C++ -*-
-// $Id: filterwidgets.h,v 1.1 2009/07/05 21:14:56 robertl Exp $
+// $Id: filterwidgets.h,v 1.2 2009/11/02 20:38:02 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
{
Q_OBJECT
public:
- CheckEnabler(QObject *parent, QCheckBox *ck, QWidget *w): QObject(parent), checkBox(ck)
+ CheckEnabler(QObject *parent, QAbstractButton *ck, QWidget *w): QObject(parent), checkBox(ck)
{
widgetList << w;
connect(ck, SIGNAL(clicked()), this, SLOT(checkStatusChanged()));
checkStatusChanged();
fixWhatsThis();
}
- CheckEnabler(QObject *parent, QCheckBox *ck, QList<QWidget *> &wl):
+ CheckEnabler(QObject *parent, QAbstractButton *ck, QList<QWidget *> &wl):
QObject(parent), checkBox(ck)
{
widgetList = wl;
}
private:
- QCheckBox *checkBox;
+ QAbstractButton *checkBox;
QList<QWidget*> widgetList;
void fixWhatsThis()
{
class BoolFilterOption: public FilterOption
{
public:
- BoolFilterOption(bool &b, QCheckBox *ck): FilterOption(), b(b), checkBox(ck)
+ BoolFilterOption(bool &b, QAbstractButton *ck): FilterOption(), b(b), checkBox(ck)
{
}
void setWidgetValue() {checkBox->setChecked(b); }
private:
bool &b;
- QCheckBox *checkBox;
+ QAbstractButton *checkBox;
};
//------------------------------------------------------------------------
for (int i=0; i<fopts.size(); i++)
fopts[i]->setWidgetValue();
}
- void addCheckEnabler(QCheckBox *ck, QWidget *w) {
+ void addCheckEnabler(QAbstractButton *ck, QWidget *w) {
enbls << new CheckEnabler(this, ck, w);
}
- void addCheckEnabler(QCheckBox *ck, QList<QWidget *> &wl)
+ void addCheckEnabler(QAbstractButton *ck, QList<QWidget *> &wl)
{
enbls << new CheckEnabler(this, ck, wl);
}
TrackWidget(QWidget *parent, TrackFilterData &tf);
virtual void checkChecks(){
- OtherCheckX();
+ otherCheckX();
FilterWidget::checkChecks();
}
private slots:
void mergeCheckX();
- void OtherCheckX();
+ void otherCheckX();
+ void splitDateX();
+ void splitTimeX();
+ void splitDistanceX();
void packCheckX();
};
-// -*- C++ -*-\r
-// $Id: format.cpp,v 1.1 2009/07/05 21:14:56 robertl Exp $\r
-//------------------------------------------------------------------------\r
-//\r
-// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.\r
-//\r
-// This program is free software; you can redistribute it and/or\r
-// modify it under the terms of the GNU General Public License as\r
-// published by the Free Software Foundation; either version 2 of the\r
-// License, or (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-// General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111\r
-// USA\r
-//\r
-//------------------------------------------------------------------------\r
-#include "format.h"\r
-\r
-static void saveOptions(QSettings &settings, const QString &prefix, const QList<FormatOption> &options) {\r
- for (int i=0; i<options.size(); i++) {\r
- QString kp = prefix + "." + options[i].getName();\r
- QString k1 = kp + ".selected";\r
- QString k2 = kp + ".value";\r
- settings.setValue(k1, options[i].getSelected());\r
- settings.setValue(k2, options[i].getValue());\r
- }\r
-}\r
-\r
-static void restoreOptions(QSettings &settings, const QString&prefix, QList<FormatOption> &options) {\r
- for (int i=0; i<options.size(); i++) {\r
- QString kp = prefix + "." + options[i].getName();\r
- QString k1 = kp + ".selected";\r
- QString k2 = kp + ".value";\r
- if (settings.contains(k1) && settings.contains(k2)) {\r
- options[i].setSelected(settings.value(k1).toBool());\r
- options[i].setValue(settings.value(k2));\r
- }\r
- }\r
-}\r
-\r
-void Format::saveSettings(QSettings &settings)\r
-{\r
- saveOptions(settings, name+".input", inputOptions);\r
- saveOptions(settings, name+".output", outputOptions);\r
-}\r
-\r
-void Format::restoreSettings(QSettings &settings)\r
-{\r
- restoreOptions(settings, name+".input", inputOptions);\r
- restoreOptions(settings, name+".output", outputOptions);\r
-}\r
-\r
-void Format::setToDefault()\r
-{\r
- for (int i=0; i<inputOptions.size(); i++) {\r
- inputOptions[i].setSelected(false);\r
- inputOptions[i].setValue(QVariant());\r
- }\r
- for (int i=0; i<outputOptions.size(); i++) {\r
- outputOptions[i].setSelected(false);\r
- outputOptions[i].setValue(QVariant());\r
- }\r
-}\r
+// -*- C++ -*-
+// $Id: format.cpp,v 1.2 2009/11/02 20:38:02 robertl Exp $
+//------------------------------------------------------------------------
+//
+// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111
+// USA
+//
+//------------------------------------------------------------------------
+#include "format.h"
+
+QString Format::htmlBase = QString();
+
+static void saveOptions(QSettings &settings, const QString &prefix, const QList<FormatOption> &options) {
+ for (int i=0; i<options.size(); i++) {
+ QString kp = prefix + "." + options[i].getName();
+ QString k1 = kp + ".selected";
+ QString k2 = kp + ".value";
+ settings.setValue(k1, options[i].getSelected());
+ settings.setValue(k2, options[i].getValue());
+ }
+}
+
+static void restoreOptions(QSettings &settings, const QString&prefix, QList<FormatOption> &options) {
+ for (int i=0; i<options.size(); i++) {
+ QString kp = prefix + "." + options[i].getName();
+ QString k1 = kp + ".selected";
+ QString k2 = kp + ".value";
+ if (settings.contains(k1) && settings.contains(k2)) {
+ options[i].setSelected(settings.value(k1).toBool());
+ options[i].setValue(settings.value(k2));
+ }
+ }
+}
+
+void Format::saveSettings(QSettings &settings)
+{
+ saveOptions(settings, name+".input", inputOptions);
+ saveOptions(settings, name+".output", outputOptions);
+}
+
+void Format::restoreSettings(QSettings &settings)
+{
+ restoreOptions(settings, name+".input", inputOptions);
+ restoreOptions(settings, name+".output", outputOptions);
+}
+
+void Format::setToDefault()
+{
+ for (int i=0; i<inputOptions.size(); i++) {
+ inputOptions[i].setSelected(false);
+ inputOptions[i].setValue(QVariant());
+ }
+ for (int i=0; i<outputOptions.size(); i++) {
+ outputOptions[i].setSelected(false);
+ outputOptions[i].setValue(QVariant());
+ }
+}
-// -*- C++ -*-\r
-// $Id: format.h,v 1.1 2009/07/05 21:14:56 robertl Exp $\r
-//------------------------------------------------------------------------\r
-//\r
-// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.\r
-//\r
-// This program is free software; you can redistribute it and/or\r
-// modify it under the terms of the GNU General Public License as\r
-// published by the Free Software Foundation; either version 2 of the\r
-// License, or (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-// General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111\r
-// USA\r
-//\r
-//------------------------------------------------------------------------\r
-#ifndef FORMAT_H\r
-#define FORMAT_H\r
-\r
-#include <QString>\r
-#include <QVariant>\r
-#include <QStringList>\r
-#include <QSettings>\r
-\r
-class FormatOption\r
-{\r
-public:\r
- typedef enum {\r
- OPTstring,\r
- OPTbool,\r
- OPTint,\r
- OPTboundedInt,\r
- OPTfloat,\r
- OPTinFile,\r
- OPToutFile,\r
- } optionType;\r
- \r
- FormatOption(): name(QString()), description(QString()), type(OPTbool), \r
- defaultValue(QVariant()), \r
- minValue(QVariant()), maxValue(QVariant()), \r
- html(QString()), value(QVariant()), selected(false)\r
- {\r
- }\r
- FormatOption(const QString &name, \r
- const QString &description,\r
- optionType type,\r
- QVariant defaultValue = QVariant(),\r
- QVariant minValue = QVariant(),\r
- QVariant maxValue = QVariant(),\r
- QString html = QString()\r
- ): name(name), description(description), type(type),\r
- defaultValue(defaultValue), minValue(minValue), maxValue(maxValue), html(html)\r
- {\r
- value = QVariant();\r
- selected = false;\r
- }\r
- FormatOption(const FormatOption & c)\r
- : name(c.name), description(c.description), type(c.type),\r
- defaultValue(c.defaultValue), minValue(c.minValue), maxValue(c.maxValue), html(c.html),\r
- value(c.value), selected(c.selected)\r
- {\r
- }\r
- \r
- QString getName() const {return name; }\r
- QString getDescription() const {return description; }\r
- optionType getType() const {return type; }\r
- QVariant getValue() const { return value; }\r
- bool getSelected() const {return selected; }\r
- QVariant getMinValue() const {return minValue; }\r
- QVariant getMaxValue() const {return maxValue; }\r
- QVariant getDefaultValue() const {return defaultValue; }\r
-\r
- void setValue(QVariant v) { value = v; };\r
- void setSelected(bool v) { selected = v; };\r
-\r
-private:\r
- QString name;\r
- QString description;\r
- optionType type;\r
- QVariant defaultValue;\r
- QVariant minValue;\r
- QVariant maxValue;\r
- QString html;\r
- QVariant value;\r
- bool selected;\r
-};\r
-\r
-\r
-//------------------------------------------------------------------------\r
-class Format \r
-{\r
- public:\r
- Format():name(QString()),\r
- description(QString()),\r
- readWaypoints(false),\r
- readTracks(false),\r
- readRoutes(false),\r
- writeWaypoints(false),\r
- writeTracks(false),\r
- writeRoutes(false),\r
- fileFormat(false),\r
- deviceFormat(false),\r
- extensions(QStringList()) \r
- {\r
- inputOptions.clear();\r
- outputOptions.clear();\r
- };\r
-\r
- Format(const QString &name,\r
- const QString &description,\r
- bool readWaypoints, bool readTracks, bool readRoutes,\r
- bool writeWaypoints, bool writeTracks, bool writeRoutes,\r
- bool fileFormat, bool deviceFormat,\r
- const QStringList &extensions,\r
- QList<FormatOption> &inputOptions, \r
- QList<FormatOption> &outputOptions):\r
- name(name), description(description),\r
- readWaypoints(readWaypoints), readTracks(readTracks), readRoutes(readRoutes),\r
- writeWaypoints(writeWaypoints), writeTracks(writeTracks), writeRoutes(writeRoutes),\r
- fileFormat(fileFormat), deviceFormat(deviceFormat),\r
- extensions(extensions),\r
- inputOptions(inputOptions),\r
- outputOptions(outputOptions)\r
- {\r
- }\r
-\r
- Format(const Format &c):\r
- name(c.name), description(c.description),\r
- readWaypoints(c.readWaypoints), readTracks(c.readTracks), readRoutes(c.readRoutes),\r
- writeWaypoints(c.writeWaypoints), writeTracks(c.writeTracks), writeRoutes(c.writeRoutes),\r
- fileFormat(c.fileFormat), deviceFormat(c.deviceFormat),\r
- extensions(c.extensions),\r
- inputOptions(c.inputOptions),\r
- outputOptions(c.outputOptions)\r
- {\r
- }\r
-\r
- ~Format() {};\r
-\r
- bool isReadWaypoints() const { return readWaypoints; };\r
- bool isReadTracks() const { return readTracks; };\r
- bool isReadRoutes() const { return readRoutes; };\r
- bool isReadSomething() const { \r
- return isReadWaypoints() || isReadTracks () || isReadRoutes(); \r
- };\r
-\r
- bool isWriteWaypoints() const { return writeWaypoints; };\r
- bool isWriteTracks() const { return writeTracks; };\r
- bool isWriteRoutes() const { return writeRoutes; };\r
- bool isWriteSomething() const { \r
- return isWriteWaypoints() || isWriteTracks () || isWriteRoutes(); \r
- };\r
-\r
- QString getName() const { return name; };\r
- QString getDescription() const { return description; };\r
- QStringList getExtensions() const { return extensions; };\r
- const QList<FormatOption> &getInputOptions() const { return inputOptions; };\r
- const QList<FormatOption> &getOutputOptions() const { return outputOptions; };\r
-\r
- QList<FormatOption> *getInputOptionsRef() { return &inputOptions; };\r
- QList<FormatOption> *getOutputOptionsRef() { return &outputOptions; };\r
-\r
- bool isDeviceFormat() const { return deviceFormat; };\r
- bool isFileFormat() const { return fileFormat; };\r
- \r
- void saveSettings(QSettings &settings);\r
- void restoreSettings(QSettings &settings);\r
- void setToDefault();\r
-\r
- private:\r
- QString name, description;\r
- bool readWaypoints, readTracks, readRoutes;\r
- bool writeWaypoints, writeTracks, writeRoutes;\r
- bool fileFormat, deviceFormat;\r
- QStringList extensions;\r
- QList<FormatOption>inputOptions;\r
- QList<FormatOption>outputOptions;\r
- \r
-};\r
-\r
-#endif\r
+// -*- C++ -*-
+// $Id: format.h,v 1.2 2009/11/02 20:38:02 robertl Exp $
+//------------------------------------------------------------------------
+//
+// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111
+// USA
+//
+//------------------------------------------------------------------------
+#ifndef FORMAT_H
+#define FORMAT_H
+
+#include <QString>
+#include <QVariant>
+#include <QStringList>
+#include <QSettings>
+
+class FormatOption
+{
+public:
+ typedef enum {
+ OPTstring,
+ OPTbool,
+ OPTint,
+ OPTboundedInt,
+ OPTfloat,
+ OPTinFile,
+ OPToutFile,
+ } optionType;
+
+ FormatOption(): name(QString()), description(QString()), type(OPTbool),
+ defaultValue(QVariant()),
+ minValue(QVariant()), maxValue(QVariant()),
+ html(QString()), value(QVariant()), selected(false)
+ {
+ }
+ FormatOption(const QString &name,
+ const QString &description,
+ optionType type,
+ QVariant defaultValue = QVariant(),
+ QVariant minValue = QVariant(),
+ QVariant maxValue = QVariant(),
+ QString html = QString()
+ ): name(name), description(description), type(type),
+ defaultValue(defaultValue), minValue(minValue), maxValue(maxValue), html(html)
+ {
+ value = QVariant();
+ selected = false;
+ }
+
+ FormatOption(const FormatOption & c)
+ : name(c.name), description(c.description), type(c.type),
+ defaultValue(c.defaultValue), minValue(c.minValue), maxValue(c.maxValue), html(c.html),
+ value(c.value), selected(c.selected)
+ {
+ }
+
+ QString getName() const {return name; }
+ QString getDescription() const {return description; }
+ optionType getType() const {return type; }
+ QVariant getValue() const { return value; }
+ bool getSelected() const {return selected; }
+ QVariant getMinValue() const {return minValue; }
+ QVariant getMaxValue() const {return maxValue; }
+ QVariant getDefaultValue() const {return defaultValue; }
+
+ void setValue(QVariant v) { value = v; };
+ void setSelected(bool v) { selected = v; };
+ QString getHtml() const { return html; };
+
+private:
+ QString name;
+ QString description;
+ optionType type;
+ QVariant defaultValue;
+ QVariant minValue;
+ QVariant maxValue;
+ QString html;
+ QVariant value;
+ bool selected;
+};
+
+
+//------------------------------------------------------------------------
+class Format
+{
+ public:
+ Format():name(QString()),
+ description(QString()),
+ readWaypoints(false),
+ readTracks(false),
+ readRoutes(false),
+ writeWaypoints(false),
+ writeTracks(false),
+ writeRoutes(false),
+ fileFormat(false),
+ deviceFormat(false),
+ extensions(QStringList()),
+ html(QString())
+ {
+ inputOptions.clear();
+ outputOptions.clear();
+ };
+
+ Format(const QString &name,
+ const QString &description,
+ bool readWaypoints, bool readTracks, bool readRoutes,
+ bool writeWaypoints, bool writeTracks, bool writeRoutes,
+ bool fileFormat, bool deviceFormat,
+ const QStringList &extensions,
+ QList<FormatOption> &inputOptions,
+ QList<FormatOption> &outputptions,
+ const QString &html):
+ name(name), description(description),
+ readWaypoints(readWaypoints), readTracks(readTracks), readRoutes(readRoutes),
+ writeWaypoints(writeWaypoints), writeTracks(writeTracks), writeRoutes(writeRoutes),
+ fileFormat(fileFormat), deviceFormat(deviceFormat),
+ extensions(extensions),
+ inputOptions(inputOptions),
+ outputOptions(outputptions),
+ html(QString())
+ {
+ }
+
+ Format(const Format &c):
+ name(c.name), description(c.description),
+ readWaypoints(c.readWaypoints), readTracks(c.readTracks), readRoutes(c.readRoutes),
+ writeWaypoints(c.writeWaypoints), writeTracks(c.writeTracks), writeRoutes(c.writeRoutes),
+ fileFormat(c.fileFormat), deviceFormat(c.deviceFormat),
+ extensions(c.extensions),
+ inputOptions(c.inputOptions),
+ outputOptions(c.outputOptions),
+ html(c.html)
+ {
+ }
+
+ ~Format() {};
+
+ bool isReadWaypoints() const { return readWaypoints; };
+ bool isReadTracks() const { return readTracks; };
+ bool isReadRoutes() const { return readRoutes; };
+ bool isReadSomething() const {
+ return isReadWaypoints() || isReadTracks () || isReadRoutes();
+ };
+
+ bool isWriteWaypoints() const { return writeWaypoints; };
+ bool isWriteTracks() const { return writeTracks; };
+ bool isWriteRoutes() const { return writeRoutes; };
+ bool isWriteSomething() const {
+ return isWriteWaypoints() || isWriteTracks () || isWriteRoutes();
+ };
+
+ QString getName() const { return name; };
+ QString getDescription() const { return description; };
+ QString getHtml() const { return html; };
+ QStringList getExtensions() const { return extensions; };
+ const QList<FormatOption> &getInputOptions() const { return inputOptions; };
+ const QList<FormatOption> &getOutputOptions() const { return outputOptions; };
+
+ QList<FormatOption> *getInputOptionsRef() { return &inputOptions; };
+ QList<FormatOption> *getOutputOptionsRef() { return &outputOptions; };
+
+ bool isDeviceFormat() const { return deviceFormat; };
+ bool isFileFormat() const { return fileFormat; };
+
+ void saveSettings(QSettings &settings);
+ void restoreSettings(QSettings &settings);
+ void setToDefault();
+ static QString getHtmlBase() { return htmlBase; }
+ static void setHtmlBase(const QString &s) { htmlBase = s; }
+
+ private:
+ QString name, description;
+ bool readWaypoints, readTracks, readRoutes;
+ bool writeWaypoints, writeTracks, writeRoutes;
+ bool fileFormat, deviceFormat;
+ QStringList extensions;
+ QList<FormatOption>inputOptions;
+ QList<FormatOption>outputOptions;
+ QString html;
+ static QString htmlBase;
+
+};
+
+#endif
// -*- c++ -*-
-// $Id: formatload.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $
+// $Id: formatload.cpp,v 1.3 2009/11/02 20:38:02 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
return false;
}
QString htmlPage = lines[currentLine++];
+ htmlPage.replace(QRegExp("^[\\s]*"), "");
+ htmlPage.replace(QRegExp("[\\s]$"), "");
QRegExp regex("^option");
QList <FormatOption> optionList;
hfields[0] == "serial",
QStringList() << hfields[3],
optionList,
- optionList2);
+ optionList2, htmlPage);
+ if (htmlPage.length() > 0 && Format::getHtmlBase().length() == 0) {
+ QString base = htmlPage;
+ base.replace(QRegExp("/[^/]+$"), "/");
+ Format::setHtmlBase(base);
+ }
return true;
}
// -*- C++ -*-
-// $Id: gmapdlg.cpp,v 1.2 2009/08/28 17:08:55 robertl Exp $
+// $Id: gmapdlg.cpp,v 1.3 2009/11/02 20:38:02 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
connect(ui.treeView, SIGNAL(customContextMenuRequested(const QPoint &)),
this, SLOT(showContextMenu(const QPoint &)));
+ connect(ui.copyButton, SIGNAL(clicked()), this, SLOT(copyButtonClickedX()));
+
+ ui.copyButton->hide(); // Hide for now, not working
}
else {
}
}
+//------------------------------------------------------------------------
+void GMapDialog::copyButtonClickedX() {
+
+}
// -*- C++ -*-
-// $Id: gmapdlg.h,v 1.1 2009/07/05 21:14:56 robertl Exp $
+// $Id: gmapdlg.h,v 1.2 2009/11/02 20:38:02 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
void routeClickedX(int i);
void treeDoubleClicked(const QModelIndex &idx);
void selectionChangedX (const QItemSelection &, const QItemSelection &);
+ void copyButtonClickedX();
void showContextMenu(const QPoint &);
<property name="windowTitle">
<string>Dialog</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <widget class="QSplitter" name="splitter">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <widget class="QTreeView" name="treeView"/>
- <widget class="QFrame" name="frame">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>10</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- </widget>
- </widget>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Close</set>
- </property>
- </widget>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QSplitter" name="splitter">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QWidget" name="">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QTreeView" name="treeView"/>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="copyButton">
+ <property name="toolTip">
+ <string>Copy to Clipboard</string>
+ </property>
+ <property name="text">
+ <string>Copy</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QFrame" name="frame">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>10</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Close</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
</layout>
</widget>
// -*- C++ -*-
-// $Id: help.cpp,v 1.7 2009/09/14 14:25:14 robertl Exp $
+// $Id: help.cpp,v 1.8 2009/11/02 20:38:02 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
// USA
//
//------------------------------------------------------------------------
-#include "help.h"
-#include <QApplication>
#include <QUrl>
-#include <QWebView>
#include <QDesktopServices>
+#include "help.h"
+#include "format.h"
+
//------------------------------------------------------------------------
-void ShowHelp(const char *name)
+void ShowHelp(const QString &urlIn)
+
{
- QString urlname("file:///" + QApplication::applicationDirPath() +
- "/help/" + name);
-#ifdef XXXX
- // This has window modality problems. Unless the problem is solved, just use
- // the native browser.
- QWebView *view = new QWebView();
- view->setWindowTitle("GPSBabel Help");
- view->load(urlname);
- view->show();
-#else
- QDesktopServices::openUrl(QUrl(urlname));
-#endif
+ QString url = urlIn;
+ if (!url.contains(QRegExp("^http://"))) {
+ url = Format::getHtmlBase() + url;
+ }
+ QDesktopServices::openUrl(QUrl(url));
}
+
+
+
-// -*- C++ -*-\r
-// $Id: help.h,v 1.3 2009/09/14 14:25:14 robertl Exp $\r
-//------------------------------------------------------------------------\r
-//\r
-// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.\r
-//\r
-// This program is free software; you can redistribute it and/or\r
-// modify it under the terms of the GNU General Public License as\r
-// published by the Free Software Foundation; either version 2 of the\r
-// License, or (at your option) any later version.\r
-//\r
-// This program is distributed in the hope that it will be useful,\r
-// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-// General Public License for more details.\r
-//\r
-// You should have received a copy of the GNU General Public License\r
-// along with this program; if not, write to the Free Software\r
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111\r
-// USA\r
-//\r
-\r
-#ifndef HELP_H\r
-#define HELP_H\r
-#include <QString>\r
-\r
-extern void ShowHelp(const char *name);\r
-\r
-\r
-#endif\r
+// -*- C++ -*-
+// $Id: help.h,v 1.4 2009/11/02 20:38:02 robertl Exp $
+//------------------------------------------------------------------------
+//
+// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of the
+// License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111
+// USA
+//
+
+#ifndef HELP_H
+#define HELP_H
+#include <QString>
+
+extern void ShowHelp(const QString & name);
+
+
+#endif
// -*- C++ -*-
-// $Id: mainwindow.cpp,v 1.11 2009/09/15 18:04:03 robertl Exp $
+// $Id: mainwindow.cpp,v 1.12 2009/11/02 20:38:02 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
{
int idx = comboBox->currentIndex();
if (idx<0 || idx >= comboBox->count()) {
- QMessageBox::critical(0, appName,
- "*** Internal Error -- current combo index is invalid!");
+ // QMessageBox::critical(0, appName, "*** Internal Error -- current combo index is invalid!");
return 0;
}
return comboBox->itemData(idx).toInt();
else {
OptionsDlg optionDlg(0,
formatList[fidx].getName(),
- formatList[fidx].getInputOptionsRef());
+ formatList[fidx].getInputOptionsRef(),
+ formatList[fidx].getHtml());
optionDlg.setWindowTitle(QString(appName) + " - " + tr("Options for %1").arg(formatList[fidx].getName()));
optionDlg.exec();
displayOptionsText(ui.inputOptionsText, ui.inputFormatCombo, true);
tr("There are no output options for format \"%1\"").arg(formatList[fidx].getDescription()));
}
else {
- OptionsDlg optionDlg(0, formatList[fidx].getName(), formatList[fidx].getOutputOptionsRef());
+ OptionsDlg optionDlg(0,
+ formatList[fidx].getName(),
+ formatList[fidx].getOutputOptionsRef(),
+ formatList[fidx].getHtml());
optionDlg.setWindowTitle(QString(appName) + " - " + tr("Options for %1").arg(formatList[fidx].getName()));
optionDlg.exec();
displayOptionsText(ui.outputOptionsText, ui.outputFormatCombo, false);
void MainWindow::moreOptionButtonClicked()
{
AdvDlg advDlg(0, bd.synthShortNames,
- bd.forceGPSTypes, bd.enableCharSetXform, bd.previewGmap, bd.debugLevel);
+ bd.enableCharSetXform, bd.previewGmap, bd.debugLevel);
connect(advDlg.formatButton(), SIGNAL(clicked()),
this, SLOT(resetFormatDefaults()));
advDlg.exec();
<rect>
<x>0</x>
<y>0</y>
- <width>297</width>
- <height>107</height>
+ <width>303</width>
+ <height>175</height>
</rect>
</property>
<property name="windowTitle">
</property>
</widget>
</item>
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Nuke (Remove) Data Types</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <property name="topMargin">
+ <number>4</number>
+ </property>
+ <property name="bottomMargin">
+ <number>4</number>
+ </property>
+ <item>
+ <widget class="QCheckBox" name="nukeRoutes">
+ <property name="text">
+ <string>Routes</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="nukeTracks">
+ <property name="text">
+ <string>Tracks</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="nukeWaypoints">
+ <property name="text">
+ <string>Waypoints</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
// -*- C++ -*-
-// $Id: optionsdlg.cpp,v 1.3 2009/09/08 16:06:32 robertl Exp $
+// $Id: optionsdlg.cpp,v 1.4 2009/11/02 20:38:02 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
}
//------------------------------------------------------------------------
-OptionsDlg::OptionsDlg(QWidget*parent, const QString &fmtName, QList<FormatOption> *opts):
+OptionsDlg::OptionsDlg(QWidget*parent, const QString &fmtName, QList<FormatOption> *opts,
+ const QString &html):
QDialog(parent),
fmtName(fmtName),
- options(*opts)
+ options(*opts),
+ html(html)
{
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
checkBox->setText(tr(options[k].getDescription().toAscii().data()));
horizontalLayout->addWidget(checkBox);
checkBox->setChecked(options[k].getSelected());
+ //checkBox->setWhatsThis(options[k].getHtml());
QSpacerItem *horizontalSpacer = new QSpacerItem(0, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout->addItem(horizontalSpacer);
//------------------------------------------------------------------------
void OptionsDlg::helpClicked()
{
- QString str = "fmt_" + fmtName + ".html";
- ShowHelp(str.toStdString().c_str());
+ ShowHelp(html);
}
// -*- C++ -*-
-// $Id: optionsdlg.h,v 1.1 2009/07/05 21:14:56 robertl Exp $
+// $Id: optionsdlg.h,v 1.2 2009/11/02 20:38:02 robertl Exp $
//------------------------------------------------------------------------
//
// Copyright (C) 2009 S. Khai Mong <khai@mangrai.com>.
class OptionsDlg: public QDialog {
Q_OBJECT
public:
- OptionsDlg(QWidget *parent, const QString &fmtName, QList<FormatOption> *options);
+ OptionsDlg(QWidget *parent, const QString &fmtName, QList<FormatOption> *options,
+ const QString &html);
private:
QString fmtName;
QDialogButtonBox *buttonBox;
QList<QCheckBox*> checkBoxes;
QList<QWidget*> fields;
+ QString html;
private slots:
void acceptClicked();
-; $Id: setup.iss,v 1.10 2009/10/12 13:23:51 robertl Exp $\r
+; $Id: setup.iss,v 1.11 2009/11/02 20:38:02 robertl Exp $\r
;\r
; NOTE: setup.iss is generated from setup.iss.in via autoconf.\r
; The generated setup.iss is checked in to help keep the version numbers\r
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)\r
AppId={{1B8FE958-A304-4902-BF7A-4E2F0F5B7017}\r
AppName=GPSBabel\r
-AppVerName=GPSBabel 1.3.7-beta20090906\r
+AppVerName=GPSBabel 1.3.7-beta20091003\r
AppPublisher=GPSBabel\r
AppPublisherURL=http://www.gpsbabel.org\r
AppSupportURL=http://www.gpsbabel.org\r
DefaultDirName={pf}\GPSBabel\r
DefaultGroupName=GPSBabel\r
OutputDir=release\r
-OutputBaseFilename=GPSBabel-1.3.7-beta20090906-Setup\r
+OutputBaseFilename=GPSBabel-1.3.7-beta20091003-Setup\r
SetupIconFile=images\babel2.ico\r
Compression=lzma\r
SolidCompression=yes\r
<rect>
<x>0</x>
<y>0</y>
- <width>544</width>
- <height>219</height>
+ <width>663</width>
+ <height>248</height>
</rect>
</property>
<property name="windowTitle">
</property>
</widget>
</item>
- <item row="1" column="1" colspan="3">
+ <item row="1" column="1" colspan="4">
<widget class="QLineEdit" name="titleText">
<property name="toolTip">
<string>the title of the new track is composed of the start time of the track appended to this value. </string>
</item>
</layout>
</item>
- <item row="2" column="2">
+ <item row="2" column="3">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QSpinBox" name="hoursSpin"/>
</item>
</layout>
</item>
- <item row="2" column="3">
+ <item row="2" column="4">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QSpinBox" name="minsSpin"/>
</item>
</layout>
</item>
- <item row="2" column="4">
+ <item row="2" column="5">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QSpinBox" name="secsSpin"/>
</property>
</widget>
</item>
- <item row="5" column="2">
- <widget class="QCheckBox" name="splitCheck">
- <property name="toolTip">
- <string>Split tracks. </string>
- </property>
- <property name="whatsThis">
- <string>Split by date or time interval
-
-The input track will be split into several tracks depending on date of track points. If there is more than one track, use the pack option before before using this.
-
-If the input has multiple tracks, pack them together before splitting them back apart per day.
-</string>
+ <item row="6" column="0" colspan="2">
+ <widget class="QRadioButton" name="splitDateCheck">
+ <property name="text">
+ <string>Split by Date</string>
</property>
+ </widget>
+ </item>
+ <item row="6" column="2">
+ <widget class="QRadioButton" name="splitTimeCheck">
<property name="text">
- <string>Split</string>
+ <string>Split by Time</string>
+ </property>
+ <property name="autoExclusive">
+ <bool>false</bool>
</property>
</widget>
</item>
- <item row="5" column="3">
+ <item row="6" column="3">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QSpinBox" name="splitTimeSpin">
</item>
</layout>
</item>
- <item row="5" column="4">
+ <item row="6" column="4">
+ <widget class="QRadioButton" name="splitDistanceCheck">
+ <property name="text">
+ <string>Split by Dist.</string>
+ </property>
+ <property name="autoExclusive">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="5">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QSpinBox" name="splitDistSpin">
</item>
</layout>
</item>
- <item row="6" column="0" colspan="2">
- <widget class="QWidget" name="widget_5" native="true">
- <property name="toolTip">
- <string>Synthesize GPS Fixes. </string>
- </property>
- <property name="whatsThis">
- <string>Synthesize GPS fixes (PPS, DGPS, 3D, 2D, NONE).
-
-This option sets the GPS fix status for all trackpoints to the specified value. Valid values for this option are PPS, DGPS, 3D, 2D, or NONE.
-
-This option is most useful when converting from a format that doesn't contain GPS fix status to one that requires it. </string>
- </property>
- <layout class="QHBoxLayout" name="horizontalLayout_3">
- <property name="margin">
- <number>0</number>
- </property>
- <item>
- <widget class="QCheckBox" name="GPSFixesCheck">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <item row="7" column="0" colspan="2">
+ <layout class="QHBoxLayout" name="horizontalLayout_8">
+ <item>
+ <widget class="QCheckBox" name="GPSFixesCheck">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>GPS Fixes</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="GPSFixesCombo">
+ <item>
+ <property name="text">
+ <string>none</string>
</property>
+ </item>
+ <item>
<property name="text">
- <string>GPS Fixes</string>
+ <string>pps</string>
</property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="GPSFixesCombo">
- <item>
- <property name="text">
- <string>none</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>pps</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>dgps</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>3d</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>2d</string>
- </property>
- </item>
- </widget>
- </item>
- </layout>
- <zorder>GPSFixesCombo</zorder>
- <zorder>GPSFixesCheck</zorder>
- </widget>
+ </item>
+ <item>
+ <property name="text">
+ <string>dgps</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>3d</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>2d</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>2</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
</item>
- <item row="6" column="3">
+ <item row="7" column="4">
<widget class="QCheckBox" name="speedCheck">
<property name="toolTip">
<string>Synthesize speed. </string>
</property>
</widget>
</item>
- <item row="6" column="4">
+ <item row="7" column="5">
<widget class="QCheckBox" name="courseCheck">
<property name="toolTip">
<string>Synthesize course.</string>